<?php
include "../include/global.php";
include "../include/admin_check.php";
include "setting.php";

$tour_id=intval($_GET['tour_id']);
$hotel_id=intval($_GET['hotel_id']);
$destination_id=intval($_GET['destination_id']);
$ID=intval($_GET['ID']);
$img=$_GET['img'];
$page=intval($_GET['page']);
if($ID){
	$stsql = "SELECT gallery_image FROM ".pre_table."gallery WHERE gallery_id='$ID'";
	$rs_img = execSQL($stsql);
	while($row_img=mysql_fetch_array($rs_img)){
		for($j=0;$j<count($MAX_THUMB_WIDTH);$j++){
			deletefile($path."thumb_".$MAX_THUMB_WIDTH[$j]."_".$row_img[gallery_image]);
		}
		if($row_img[gallery_image]){
			$Image_del = deletefile($path.$row_img[gallery_image]);
		}
	}
	
	$stsql = "DELETE FROM ".pre_table."gallery WHERE gallery_id='$ID'";
	$rs = execSQL($stsql);
	echo "<script language = 'javascript'>
			location.href = 'gallery.php?tour_id=$tour_id&hotel_id=$hotel_id&destination_id=$destination_id&page=$page';
		</script>";
	exit(); 
}


?>

